#@adminLayout()
#define main()
<div class="jbolt_page" data-key="#(pmkey)">
    <div class="jbolt_page_title">
        <div class="row">
            <div class="col-2">
                <h1>商家优惠管理</h1>
                <span> #(pageData.totalRow?? 0) 条记录</span>
            </div>
            <div class="col-8" >
                <form class="form-inline"  id="retailerCouponForm" action="/auth/mall/retailer/coupon"  data-pjaxsubmit  method="get">
                    <select class="form-control"
                            name="retailerId"
                            id="retailerId"
                            data-autoload
                            data-url="/auth/mall/retailer/options"
                            data-text="请选择商家"
                            data-value=""
                            data-select="#(retailerId??)"
                    >
                    </select >
                    <select class="form-control ml-1"  data-url="/auth/mall/retailer/coupon/get_retailer_coupon_time" id="onTime" name="onTime" data-autoload data-text="=过期时间=" data-value="" data-select="#(onTime??)"></select>
                    <button  type="submit" class="btn btn-light" ><i class="fa fa-search"></i> 查询</button>
                    <button    onclick="TestOrderreset()" data-handler="reloadCurrentPage" class="btn btn-light" ><i class="fa fa-refresh"></i> 重置</button>
                </form>
            </div>

            <div class="col-2">
                <button data-area="800,500" data-handler="refreshPjaxContainer"   data-jboltlayertrigger  data-width="500"   data-noclose  data-confirm   data-title="新增" data-url="/auth/mall/retailer/coupon/add" class="pull-right jbolt_table_addbtn btn btn-success" ><i class="fa fa-plus"></i> 新增</button>
            </div>


        </div>
    </div>
    <div class="jbolt_page_content">
        <div class="table-responsive">
            <table class="table table-bordered table-hover table-striped table-center">
                <thead>
                <tr>
                    <th style="width: 60px">序号</th>
                    <th style="width: 200px">商家</th>
                    <th style="width:120px;">充值金额(元)</th>
                    <th style="width:120px;">赠送金额(元)</th>
                    <th style="width:120px;">过期时间</th>
                    <th style="width:60px">操作</th>
                </tr>
                </thead>
                <tbody>
                #if(pageData??)
                #for(data:pageData.list??)
                <tr>
                    <td>#(for.index+1??)</td>

                    <td>#(data.retailer_name??)</td>


                    <td>#(MyUtil.get_price_string(data.amount??)??)</td>
                    <td>#(MyUtil.get_price_string(data.bonus??)??)</td>
                    <td>#(MyUtil.get_date(data.expired??)??)</td>


                    <td>
                        <a  tooltip  title="编辑"  class="jbolt_table_delbtn" data-confirm  data-jboltlayertrigger  href="/auth/mall/retailer/coupon/modify/#(data.id)" class="btn btn-info"   data-width="500"  data-noclose><i class="fa fa-pencil c-primary"></i></a>
                        <a  tooltip  title="删除"  href="/auth/mall/retailer/coupon/delete/#(data.id)" data-handler="refreshPjaxContainer" data-confirm="确定删除此优惠？" class="jbolt_table_delbtn"><i class="fa fa-remove c-danger"></i></a>

                    </td>
                </tr>
                #end
                #end




                </tbody>
            </table>
        </div>
        #include("/_view/_admin/common/_page.html",pageEleId="retailerCouponPage")
    </div>
</div>
#end
#define js()
<script>

    $(function(){
        initPage("retailerCouponPage",#(pageData.totalPage??),#(pageData.pageNumber??),"retailerCouponForm");
    });


    //测试可刷新 -- 提交表单
    function RefreshsubmitForm(formEId){
        var form=getRealJqueryObject(formEId);
        if(FormChecker.check(form)){

            var url=form.action;
            form.ajaxSubmit({
                type:"post",
                url:url,
                success:function(ret) {
                    if (ret.state == "ok") {
                        LayerMsgBox.success(ret.msg, 500,function () {
                            refreshPjaxContainer();
                        });

                    } else {
                        LayerMsgBox.alert(ret.msg, 2);
                    }
                }
            });
        }
        return false;
    }


    function TestOrderreset() {


        document.getElementById("retailerId").value = "";

        document.getElementById("onTime").value = "";
    }


</script>
#end

